package com.sz.app.edi.job.order;

import com.sz.common.base.job.JobScheduler;
import com.sz.common.base.logger.Logger;

import com.sz.biz.logistics.ord.service.OrderCalcJobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.concurrent.ExecutionException;

/**
 * Function: 运费汇率填充计算定时任务 <br>
 * Author: cwt. <br>
 * Date: 2017-06-13 14:26:00.
 */
@Service("orderFeeExchangeRateCalcScheduler")
public class OrderFeeExchangeRateCalcSchedulerImpl implements JobScheduler {
    Logger logger = Logger.getLogger(this.getClass());

    @Autowired
    private OrderCalcJobService orderCalcJobService;

    /**
     * 定时任务调用计算所有未计费订单
     */
    @Override
    public void execute() throws InterruptedException, ExecutionException {
        long start = System.currentTimeMillis();
        logger.info("==============start orderFeeExchangeRateCalcScheduler");
        orderCalcJobService.calcExchangeRateCron();
        long end = System.currentTimeMillis();
        logger.info("==============end orderFeeExchangeRateCalcScheduler,use time:" +(end-start)+"ms");
    }


}
